<template>
  <a-spin :spinning="confirmLoading">
    <j-form-container :disabled="false">
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row :gutter="48">
          <a-col :span="24">
            <a-form-model-item label="月表数据" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="monthId">
              <a-input :disabled=formDisabled v-model="model.monthId" placeholder="请输入月表数据"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dayDate">
              <a-input :disabled=formDisabled v-model="model.dayDate" placeholder="请输入时间"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="employeeId">
              <a-input :disabled=formDisabled v-model="model.employeeId" placeholder="请输入姓名"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="企业微信账号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="wxUserId">
              <a-input :disabled=formDisabled v-model="model.wxUserId" placeholder="请输入企业微信账号"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="部门" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departId">
              <a-input :disabled=formDisabled v-model="model.departId" placeholder="请输入部门"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="postId">
              <a-input :disabled=formDisabled v-model="model.postId" placeholder="请输入职务"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="规则id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="groupId">
              <a-input :disabled=formDisabled v-model="model.groupId" placeholder="请输入规则id"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="规则名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="groupName">
              <a-input :disabled=formDisabled v-model="model.groupName" placeholder="请输入规则名称"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="班次" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderOfClasses">
              <a-input :disabled=formDisabled v-model="model.orderOfClasses" placeholder="请输入班次"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="日报类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dayType">
              <a-input :disabled=formDisabled v-model="model.dayType" placeholder="请输入日报类型"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="当日打卡次数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="checkinCount">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.checkinCount" placeholder="请输入当日打卡次数" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="工作时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="regularWorkHour">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.regularWorkHour" placeholder="请输入工作时长" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="标准工作时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardWorkHour">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.standardWorkHour" placeholder="请输入标准工作时长" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="最早打卡时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="earliestTime">
              <a-input :disabled=formDisabled v-model="model.earliestTime" placeholder="请输入最早打卡时间"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="最晚打卡时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lastestTime">
              <a-input :disabled=formDisabled v-model="model.lastestTime" placeholder="请输入最晚打卡时间"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="假勤信息" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="spDescription">
              <a-input :disabled=formDisabled v-model="model.spDescription" placeholder="请输入假勤信息"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="异常信息" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="exceptionDescription">
              <a-input :disabled=formDisabled v-model="model.exceptionDescription" placeholder="请输入异常信息"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="迟到次数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lateCount">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.lateCount" placeholder="请输入迟到次数" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="迟到时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lateDuration">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.lateDuration" placeholder="请输入迟到时长" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="早退次数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leaveEarlyCount">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.leaveEarlyCount" placeholder="请输入早退次数" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="早退时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leaveEarlyDuration">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.leaveEarlyDuration" placeholder="请输入早退时长" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="缺卡次数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="missingCardCount">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.missingCardCount" placeholder="请输入缺卡次数" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="旷工次数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="absentWorkCount">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.absentWorkCount" placeholder="请输入旷工次数" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="旷工时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="absentWorkDuration">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.absentWorkDuration" placeholder="请输入旷工时长" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="地点异常次数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationAnomalyCount">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.locationAnomalyCount" placeholder="请输入地点异常次数" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="设备异常次数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unitExceptionCount">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.unitExceptionCount" placeholder="请输入设备异常次数" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="加班状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="otStatus">
              <a-input :disabled=formDisabled v-model="model.otStatus" placeholder="请输入加班状态"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="加班时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="otDuration">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.otDuration" placeholder="请输入加班时长" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="补卡次数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="replenishmentCardCount">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.replenishmentCardCount" placeholder="请输入补卡次数" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="外勤次数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fieldWorkCount">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.fieldWorkCount" placeholder="请输入外勤次数" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="外出小时" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="outDuration">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.outDuration" placeholder="请输入外出小时" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="出差天数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="travelDuration">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.travelDuration" placeholder="请输入出差天数" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="年假天数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="annualLeaveDuration">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.annualLeaveDuration" placeholder="请输入年假天数" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="事假(小时)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="askLeaveDuration">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.askLeaveDuration" placeholder="请输入事假(小时)" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="病假(小时)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sickLeaveDuration">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.sickLeaveDuration" placeholder="请输入病假(小时)" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="调休假(小时)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leaveDuration">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.leaveDuration" placeholder="请输入调休假(小时)" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="婚假天数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="marriageLeaveDuration">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.marriageLeaveDuration" placeholder="请输入婚假天数" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="产假天数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maternityLeaveDuration">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.maternityLeaveDuration" placeholder="请输入产假天数" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="陪产假天数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="accompanyingLaborDuration">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.accompanyingLaborDuration" placeholder="请输入陪产假天数" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="哺乳假天数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="breastfeedingLeaveDuration">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.breastfeedingLeaveDuration" placeholder="请输入哺乳假天数" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="其他天数" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="otherDuration">
              <a-input-number :disabled=formDisabled :max="99999999" :min="0"  v-model="model.otherDuration" placeholder="请输入其他天数" style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
              <a-input :disabled=formDisabled v-model="model.status" placeholder="请输入状态"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="调整状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="adjustStatus">
              <a-input :disabled=formDisabled v-model="model.adjustStatus" placeholder="请输入调整状态"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="调整时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="adjustTime">
              <j-date :disabled=formDisabled placeholder="请选择调整时间" v-model="model.adjustTime"  style="width: 100%" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="调整人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="adjustEmployee">
              <a-input :disabled=formDisabled v-model="model.adjustEmployee" placeholder="请输入调整人"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="调整说明" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="adjustRemark">
              <a-input :disabled=formDisabled v-model="model.adjustRemark" placeholder="请输入调整说明"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="校准状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardStatus">
              <a-input :disabled=formDisabled v-model="model.standardStatus" placeholder="请输入校准状态"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否迟到" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isLate">
              <a-input :disabled=formDisabled v-model="model.isLate" placeholder="请输入是否迟到"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否早退" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isLeave">
              <a-input :disabled=formDisabled v-model="model.isLeave" placeholder="请输入是否早退"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否旷工" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isAbsentWork">
              <a-input :disabled=formDisabled v-model="model.isAbsentWork" placeholder="请输入是否旷工"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否缺卡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isMissing">
              <a-input :disabled=formDisabled v-model="model.isMissing" placeholder="请输入是否缺卡"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否地点异常" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isLocationAnomaly">
              <a-input :disabled=formDisabled v-model="model.isLocationAnomaly" placeholder="请输入是否地点异常"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否设备异常" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isUnitException">
              <a-input :disabled=formDisabled v-model="model.isUnitException" placeholder="请输入是否设备异常"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否工作日加班" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isWorkOver">
              <a-input :disabled=formDisabled v-model="model.isWorkOver" placeholder="请输入是否工作日加班"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否节假日加班" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isHolidaysOver">
              <a-input :disabled=formDisabled v-model="model.isHolidaysOver" placeholder="请输入是否节假日加班"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否休息日加班" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isRestdaysOver">
              <a-input :disabled=formDisabled v-model="model.isRestdaysOver" placeholder="请输入是否休息日加班"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否补卡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isReplenishmentCard">
              <a-input :disabled=formDisabled v-model="model.isReplenishmentCard" placeholder="请输入是否补卡"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否外勤打卡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isFieldWork">
              <a-input :disabled=formDisabled v-model="model.isFieldWork" placeholder="请输入是否外勤打卡"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否外出" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isOut">
              <a-input :disabled=formDisabled v-model="model.isOut" placeholder="请输入是否外出"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否出差" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isTravel">
              <a-input :disabled=formDisabled v-model="model.isTravel" placeholder="请输入是否出差"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否年假" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isAnnualLeave">
              <a-input :disabled=formDisabled v-model="model.isAnnualLeave" placeholder="请输入是否年假"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否事假" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isAskLeave">
              <a-input :disabled=formDisabled v-model="model.isAskLeave" placeholder="请输入是否事假"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否病假" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isSickLeave">
              <a-input :disabled=formDisabled v-model="model.isSickLeave" placeholder="请输入是否病假"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否调休" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isRestLeave">
              <a-input :disabled=formDisabled v-model="model.isRestLeave" placeholder="请输入是否调休"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否婚假" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isMarriageLeave">
              <a-input :disabled=formDisabled v-model="model.isMarriageLeave" placeholder="请输入是否婚假"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否产假" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isMaternityLeave">
              <a-input :disabled=formDisabled v-model="model.isMaternityLeave" placeholder="请输入是否产假"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否陪产假" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isAccompanyingLabor">
              <a-input :disabled=formDisabled v-model="model.isAccompanyingLabor" placeholder="请输入是否陪产假"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否哺乳假" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isBreastfeedingLeave">
              <a-input :disabled=formDisabled v-model="model.isBreastfeedingLeave" placeholder="请输入是否哺乳假"  ></a-input>
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="是否其他假" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="isOther">
              <a-input :disabled=formDisabled v-model="model.isOther" placeholder="请输入是否其他假"  ></a-input>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </j-form-container>
  </a-spin>
</template>

<script>

  import { httpAction, getAction } from '@/api/manage'
  import { validateDuplicateValue } from '@/utils/util'

  export default {
    name: 'ErpEmployeeAttendanceDayForm',
    components: {
    },
    props: {
      //表单禁用
      disabled: {
        type: Boolean,
        default: false,
        required: false
      }
    },
    data () {
      return {
        model:{
         },
        labelCol: {
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 24 },
        },
        confirmLoading: false,
        validatorRules: {
        },
        url: {
          add: "/api/erp/hr/attendance/erpEmployeeAttendanceDay/add",
          edit: "/api/erp/hr/attendance/erpEmployeeAttendanceDay/edit",
          queryById: "/api/erp/hr/attendance/erpEmployeeAttendanceDay/queryById"
        }
      }
    },
    computed: {
      formDisabled(){
        return this.disabled
      },
    },
    created () {
       //备份model原始值
      this.modelDefault = JSON.parse(JSON.stringify(this.model));
    },
    methods: {
      add () {
        this.edit(this.modelDefault);
      },
      edit (record) {
        this.$refs.form.resetFields();
        this.model = Object.assign({}, record);
        this.visible = true;
      },
      submitForm () {
        const that = this;
        // 触发表单验证
        this.$refs.form.validate(valid => {
          if (valid) {
            that.confirmLoading = true;
            let httpurl = '';
            let method = '';
            if(!this.model.id){
              httpurl+=this.url.add;
              method = 'post';
            }else{
              httpurl+=this.url.edit;
               method = 'put';
            }
            httpAction(httpurl,this.model,method).then((res)=>{
              if(res.success){
                that.$message.success(res.message);
                that.$emit('ok');
              }else{
                that.$message.warning(res.message);
              }
            }).finally(() => {
              that.confirmLoading = false;
            })
          }

        })
      },
    }
  }
</script>
